package view;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import entity.Color;
import service.BorrowBookServiceImpl;
import service.Journal;
import tool.MyTool;
import tool.TSUtility;

import java.io.IOException;

public class ManagerView {
   public void managerMenu() throws Exception {
       OperatorView operatorView=new OperatorView();
       while (true) {
           System.out.println(Color.getAnsiBlue());
           System.out.println("🔣-------~管理员操作~----------------🔣");
           System.out.println("🐕-------<1.员工工作日志记录>---------*");
           System.out.println("🐖-------<2.图书金额设定>------------*");
           System.out.println("🐱-------<3.员工信息管理>------------*");
           System.out.println("🐱-------<4.图书逾期罚金账单查询>------*");
           System.out.println("🐕-------<5.退出>-------------------*");
           char c = MyTool.selectMenu(5).charAt(0);
           switch (c) {
               case '1':
                   recordWork();
                   break;
               case '2':
                   FineView.fineMenu();
                   break;
               case '3':
                   operatorView.OperatorMenu();
                   break;
               case '4':
                   BorrowBookServiceImpl.fineLog();
                   break;
               case '5':
                   return;
           }
       }
   }


   public void recordWork() throws IOException {
       System.out.println("请输入日志：");
       String s = TSUtility.readString(200, null);
       Journal.record(LogView.getManager().getName(),"添加了员工日志","：-----",s);
       System.out.println("添加员工日志成功");
   }
}
